package utils

import (
	"crypto/sha256"
	"encoding/base64"
)

func HashStr(s, salt string) string {
	hasher := sha256.New()
	hasher.Write([]byte(s + salt))
	// 计算hash值
	passBytes := hasher.Sum(nil)
	passHash := base64.StdEncoding.EncodeToString(passBytes)
	return passHash
}
